<template>
	<view class="main">
		<web-view :src="webviewSrc"  v-if="webviewSrc !== ''"></web-view>
	</view>
</template>

<script setup lang="ts">
	import { ref, onMounted, onUnmounted } from 'vue'
	import { onLoad, onShow, } from "@dcloudio/uni-app"
	const webviewSrc = ref("")
	const currentUrl = ref(null)
	onLoad(({url}) => {
		console.log("--->", url)
		const options = uni.getStorageSync(`${url}`);
		currentUrl.value = url
		webviewSrc.value = `${url}?${options}`
	})
	onUnmounted(() => {
		if(currentUrl.value){
			uni.removeStorageSync(currentUrl.value)
		}
	})
</script>

<style scoped lang="scss">
	.main{
		min-width: 100%;
		min-height: 100%;
	}
</style>